#ifndef __SERIAL_H
#define __SERIAL_H

#include <stdio.h>

extern char Serial_RxPacket[];
extern uint8_t Serial_RxFlag;

extern char Serial_Rx_Buffer[];				//定义接收缓冲区数组
extern uint16_t Serial_Rx_Length;			//定义接收缓冲区长度


void Serial_Rx_Buffer_Clear(void);

void Serial_Init(void);
void Serial_SendByte(uint8_t Byte);
void Serial_SendArray(uint8_t *Array, uint16_t Length);
void Serial_SendString(char *String);
void Serial_SendNumber(uint32_t Number, uint8_t Length);
void Serial_Printf(char *format, ...);

// 检查串口是否空闲
uint8_t Serial_Is_Idle(void);

#endif
